package com.jason.nio;

import java.net.SocketAddress;
import java.nio.channels.SocketChannel;

public class NioSession {
	
	private NioServer server;
	
	private IoHandler handler;
	
	private NioIoProcesser processer;
	
	private SocketChannel ch;
	
	private SocketAddress remoteAddress;
	
	private SocketAddress localAddress;
	
	private int readBufferSize = 1024;
	
	public NioSession(NioServer server,NioIoProcesser processer,SocketChannel ch,IoHandler handler){
		this.server = server;
		this.processer = processer;
		this.ch = ch;
		this.remoteAddress = ch.socket().getRemoteSocketAddress();
		this.localAddress = ch.socket().getLocalSocketAddress();
		this.handler = handler;
	}

	public NioServer getServer() {
		return server;
	}

	public void setServer(NioServer server) {
		this.server = server;
	}

	public IoHandler getHandler() {
		return handler;
	}

	public void setHandler(IoHandler handler) {
		this.handler = handler;
	}

	public NioIoProcesser getProcesser() {
		return processer;
	}

	public void setProcesser(NioIoProcesser processer) {
		this.processer = processer;
	}

	public SocketChannel getCh() {
		return ch;
	}

	public void setCh(SocketChannel ch) {
		this.ch = ch;
	}

	public SocketAddress getRemoteAddress() {
		return remoteAddress;
	}

	public void setRemoteAddress(SocketAddress remoteAddress) {
		this.remoteAddress = remoteAddress;
	}

	public SocketAddress getLocalAddress() {
		return localAddress;
	}

	public void setLocalAddress(SocketAddress localAddress) {
		this.localAddress = localAddress;
	}

	public int getReadBufferSize() {
		return readBufferSize;
	}

	public void setReadBufferSize(int readBufferSize) {
		this.readBufferSize = readBufferSize;
	}
	
	
	

}
